const express = require("express");
const { upload } = require("../helpers/filehelper");
const fileuploaderController = require("../controllers/fileuploaderController");
const router = express.Router();

router
  .route("/")
  .post(upload.single("file"), fileuploaderController.singleFileUpload); //上传单个文件

router
  .route("/multi")
  .post(upload.array("files", 9), fileuploaderController.multiFileUpload) //批量上传
  .delete(fileuploaderController.multiDelete) //批量删除
  .patch(upload.array("files", 9), fileuploaderController.editFiles); //批量修改 单个改也可以哒~

router.route("/:id").delete(fileuploaderController.singleDelete); //删除单个文件

module.exports = router;
